package com.example.zyh.toolslib.base;

import com.google.gson.Gson;

import okhttp3.RequestBody;

/**
 * @author shichen 754314442@qq.com
 * Created by gk on 2017/9/13.
 */

public class BaseResult {
    @Override
    public String toString() {
        Gson gson = new Gson();
        return gson.toJson(this);
    }

    /**
     * 请求时的body
     * @return
     */
    public RequestBody createRequestBody(){
        return RequestBody.create(okhttp3.MediaType.parse("application/json; charset=utf-8"), toString());
    }
}
